{extend name="public/base" /}
{block name="content"}
<form class="layui-form layui-form-pane form-search" action="{:url()}" onsubmit="return false" method="post" autocomplete="off">
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">用户id</label>
        <label class="layui-input-inline">
            <input  type="number" name="member_id" value="" placeholder="" class="layui-input">
        </label>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">用户名</label>
        <label class="layui-input-inline">
            <input type="text" name="email" value="" placeholder="" class="layui-input">
        </label>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">提现单号</label>
        <label class="layui-input-inline">
            <input type="text" name="order_sn" value="" placeholder="" class="layui-input">
        </label>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">提现状态</label>
        <div class="layui-input-inline">
            <select name="status" lay-search class="layui-select">、
                <option value=''>全部</option>
                <option value='1'>审核中</option>
                <option value='2'>通过</option>
                <option value='-1'>驳回</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">提现时间</label>
        <div class="layui-input-inline">
            <input data-date-range name="create_at" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i>搜索</button>
    </div>
</form>
<table id="withdraw"  data-url="{:url('index')}" data-target-search="form.form-search"></table>
{/block}
{block name='script'}
<script>
    $(function () {
        $('#withdraw').layTable({
            even: true,
            height: 'full',
            method: 'post',
            sort: {field: 'id', type: 'desc'},
            url: "{:url('index')}" ,
            where: {
                status: 0,
                create_at: "",
                email: "",
                member_id: 0,
                order_sn:""
            },
            page: true,
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'id', title: 'id', width: 80, align: 'center'},
                {field: 'member_id', title: '会员id', width: 80, align: 'center'},
                {field: 'email', title: '用户名', align: 'center', width: 180,templet:function (d){
                    return d.member.email;
                }},
                {field: 'coin_name', title: '币种名称', align: 'center',width: 80,templet:function(d){
                     return d.coin.coin_name;
                }},
                {field: 'create_at', title: '申请时间', align: 'center',width: 150},
                {field: 'address', title: '提币地址', align: 'left',templet:function (d) {
                     return "<span data-copy>"+d.address.address+"<i class='layui-icon layui-icon-file-b'></i></span>";
                }},

                {field: 'status_text', title: '交易状态', align: 'center',width: 80},
                {field: 'order_sn', title: '申请单号', align: 'left',width: 170},
                {field: 'num', title: '提币数量', align: 'left',width: 80},
                {field: 'fee', title: '手续费', align: 'left',width: 80},
                {field: 'remark', title: '审核原因', align: 'left',width: 300},
                {field: 'num', title: '实际到账',width: 80, align: 'left',templet:function (d){
                         return  d.receive_num;
                }},
                {toolbar: '#toolbar', title: '操作面板', align: 'center', width: 80, fixed: 'right'}
            ]]
        });
        $.menu.highlight_subnav("{:url('index')}")
    });
</script>
<script type="text/html" id="toolbar">
    {{-d.status!=1 ? '已经处理' : ''}}
    <a class="layui-btn layui-btn-sm"  data-title="提现审核"  {{-d.status!=1 ? 'style="display:none;"' : ''}}  data-modal='{:url("audit")}?id={{d.id}}'>审核</a>
</script>
{/block}
